<?php

namespace App\Validators\Teacher;

use App\Validators\PassesValidator;
use \Prettus\Validator\Contracts\ValidatorInterface;
use \Prettus\Validator\LaravelValidator;

class StudyValidator extends LaravelValidator
{
    use PassesValidator;
    protected $rulesMessages=[
        'teacher_id.required' => '教师ID不能为空',
        'sponsor.required' => '主办方是必填的',
        'content.required'  => '进修内容是必填的',
        'start_date.required'  => '时间是必填的',
        'finish_date.required'  => '时间是必填的',
        'score.required'   =>  '成绩是必填',
    ];

    protected $rules = [
        ValidatorInterface::RULE_CREATE => [
            'teacher_id'=>'required',
            'sponsor'=>'required',
            'content'=>'required',
            'start_date'=>'required',
            'finish_date'=>'required',
            'score'=>'required',
        ],
        ValidatorInterface::RULE_UPDATE => [],
   ];
}
